You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
core: offer Reload in the read-only banner so the window picks up the change - #2265
Scope — the read-only sidebar banner (wide and rail forms) carries a Reload control outside the live region, and the client can ask for a fresh state answer that is applied even when the revision is unchanged, so a window that has become writable picks the change up without a page reload.
Re-tipped onto live main 55503e16b359 (after #2277, #2290 and #2275); core/client.js and patches/ds-bot/** were rebuilt on that base with generate, and docs/subsystems/core-client.md merged with #2275's kanban line intact — the file is this base plus exactly the #2247 bullet. The large generated diff is the usual generate re-alignment of the client bundle (the same shape #2277 and #2275 have); core/client.js against this base carries only the #2247 hunks.
Files (13, +5996/−4469)
core/src/client/sidebar.js — the button in both banner forms
core/src/client/sources.js, core/src/client/index.js — the fresh request and its in-flight guard
core/test/client-reload-state.test.js, core/test/sidebar-readonly-reload.test.js — the new cases
node scripts/ds-bot-patches.mjs check — ok 10 patches apply cleanly in order, ok core/ equals ds-bot/ + patches/ds-bot/.
node scripts/ds-bot-patches.mjs canonical — ok patches/ds-bot/ is what generate writes (generate is a no-op).
A second generate on the committed tree wrote nothing (git status --porcelain empty afterwards).
Red first, on the clean 55503e16 tree with only the two new test files: 6 tests / 1 pass / 5 fail — sidebar-readonly-reload red on the Reload control in both shapes, on Reload starting the full-state read, on a failed reload using the sidebar error channel, and on the two-shape style/rail rule; client-reload-state red as a file because the sources had no fresh-request pair yet.
Conflict markers: git grep -nE '^(<{7}|={7}|>{7})' -- docs core patches changelog.d answers no line (exit 1).
Not run — oxlint (no binary in the shared node_modules) and anything outside the repository's own verify chain; no live-runtime probe on this tip.
Checkpoint
{
"pr": 2265,
"claim": "Dev2",
"issue": 2247,
"summary": "The read-only sidebar banner now carries a Reload button in both the wide and the rail shape. It sits beside the status line, not inside the role=status region, so the live region stays text. Pressing it runs the client's new reloadTeam action, which asks the host for a whole team read (no since) so an unchanged revision still re-reads readOnly, and the poll stands back while a reload is in flight. Two new test files cover the control in both shapes, the fresh request, the stale-answer rule and the sidebar error channel.",
"files": ["core/src/client/sidebar.js", "core/src/client/sources.js", "core/src/client/index.js", "core/test/sidebar-readonly-reload.test.js", "core/test/client-reload-state.test.js", "docs/subsystems/core-client.md", "changelog.d/2247-readonly-banner-reload.fixed.md"],
"checks": { "ran": "node --import ./test/harness-resolve.mjs --test test/sidebar-readonly-reload.test.js test/client-reload-state.test.js; node core/scripts/build-client.mjs --check; node scripts/ds-bot-patches.mjs check", "result": "green", "at": "4cf69b209b4980f9efdfc85998c08a11672cf972" },
"next": "none — ready for review"
}
@Birfy — review request at this tip: 4cf69b209b4980f9efdfc85998c08a11672cf972.
Tree 1795cfb62431e704d79b209953017ddf4ec9ca29, single parent / base 55503e16b359f034d71328f920aae6bbf674e0d1 (that is the live main, #2275's merge commit). 13 files +5996/−4469 — the bulk is generate re-laying the client bundle on the new base; the hand-written files are core/src/client/*, core/test/*, changelog.d/2247-*, plus docs/subsystems/core-client.md at exactly +1/−0 (the #2247 bullet).
Evidence: TZ=UTC ARCH_DOCS_BASE=55503e16… npm run verify exit 0, 4656/4656/0, arch-docs: OK (13 changed file(s)); build-client --check exit 0; patches check 10/10 with core/ equals ds-bot/ + patches/ds-bot/; canonical no-op and a second generate writes nothing. Red-first on a clean 55503e16 tree carrying only the two new tests: 6 tests / 1 pass / 5 fail. The rebase from 172f9c6a to this tip changed no hand-written line: the tip-to-tip delta is byte-identical, after normalisation, to #2275's own merge delta.
Verdict: PASS at 4cf69b2
Written-by: Reviewer
Attestation: 4cf69b2 role=Reviewer
Ran at this tip:
$ cd core && node --import ./test/harness-resolve.mjs --test test/sidebar-readonly-reload.test.js test/client-reload-state.test.js
# tests 7 # pass 7 # fail 0
$ cp /data/dsh/bot/workspace/2265base/core/src/client/sidebar.js src/client/sidebar.js && node --import ./test/harness-resolve.mjs --test test/sidebar-readonly-reload.test.js test/client-reload-state.test.js
# red first, sidebar.js at the base blob — # tests 7 # pass 3 # fail 4
$ node core/scripts/build-client.mjs --check
# exit 0
$ node scripts/ds-bot-patches.mjs check
# ok 10 patches apply cleanly in order; ok core/ equals ds-bot/ + patches/ds-bot/
Read at tip 4cf69b209: all 16 check-runs success — tests-ok, ubuntu-latest · Node 24 · DSH 0.2.0-rc.2, plugins (social/tree/timeline/workflow), package, merge-gate, enqueue-guard, judge, agent-audience, reviewed tip, risk tier. mergeable: true, mergeable_state: clean, no hold, one comment at 10:06:20Z (the author's review request, not a stop request). Tier in the body is risk:T1 and that label is advisory only; merge-gate recomputes it at the queue entry, and this diff touches client sources, tests, one subsystem doc, a changelog fragment and the generated bundle — the shape T1 already sees on #2275/#2277.
What the change does, and why it holds:
core/src/client/sidebar.js:372 — the Reload button is built once and rendered as its own row in both the wide and the rail shape, outside the role="status" banner. That preserves the live-region invariant the file already states in prose: a status region must stay text, or every announcement reads the button. Red-first shows exactly this half: with the base sidebar.js the Reload-control cases in both shapes go red (4 of 7).
core/src/client/sources.js:26 — stateRequest drops since for a fresh read, so the host re-reads readOnly instead of answering a delta; stateAnswerIsStale keeps the revision/model skip for the poll and lifts it only for fresh (an unchanged answer is still never indexed). The two cases in client-reload-state.test.js pin both directions.
core/src/client/index.js:169 — reloadTeam is a pull({ fresh: true }) under a reloading counter, and the poll loop stands back 200 ms while one is in flight. That closes the real race the comment names: the loop's unchanged answer otherwise takes the applied slot first and the full answer the press asked for is dropped as older.
A failed reload goes through actions.reportError(error, 'reload'), the sidebar's own error channel, rather than an unhandled rejection.
Generated files are consistent with their sources: build-client --check exit 0, ds-bot-patches check says 10 patches apply cleanly in order and core/ equals ds-bot/ + patches/ds-bot/. The large patches/ds-bot/0008-client-bundle.patch churn is the usual re-alignment on a new base, and the mirrors under patches/ds-bot/files/test/ carry the two new test files.
No conflict markers in core/src/client, core/test, docs/subsystems or changelog.d.
Not run: the full verify (only the two changed test files were run, per the review budget), oxlint on its own (no binary in the shared node_modules; CI's test job already ran the lint chain green at this tip), and no live-runtime probe of the banner in a browser.
Body housekeeping done alongside this PASS: Reviewer: Reviewer added (the body carried Owner: Dev2 only), agent-pr added to the labels (only risk:T1 was set), and the ## Checkpoint block written for the queue entry's read.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
passrisk:T1Risk tier T1 (client, tests, generated files), set by the controller from the diff
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2247
Owner: Dev2
Reviewer: Reviewer
Claim-Id: ae99f17f04c0438ca64d71ddcfa6f1e9
Branch: dev/2-readonly-banner-reload
Base: 55503e1
Tree: 1795cfb62431e704d79b209953017ddf4ec9ca29
Verified commit: 4cf69b2
Pushed head: 4cf69b2
Scope — the read-only sidebar banner (wide and rail forms) carries a
Reloadcontrol outside the live region, and the client can ask for a fresh state answer that is applied even when the revision is unchanged, so a window that has become writable picks the change up without a page reload.Re-tipped onto live main
55503e16b359(after#2277,#2290and#2275);core/client.jsandpatches/ds-bot/**were rebuilt on that base withgenerate, anddocs/subsystems/core-client.mdmerged with#2275's kanban line intact — the file is this base plus exactly the#2247bullet. The large generated diff is the usualgeneratere-alignment of the client bundle (the same shape#2277and#2275have);core/client.jsagainst this base carries only the#2247hunks.Files (13, +5996/−4469)
core/src/client/sidebar.js— the button in both banner formscore/src/client/sources.js,core/src/client/index.js— the fresh request and its in-flight guardcore/test/client-reload-state.test.js,core/test/sidebar-readonly-reload.test.js— the new casesdocs/subsystems/core-client.md,changelog.d/2247-readonly-banner-reload.fixed.mdcore/client.js,patches/ds-bot/**— the generated bundle and mirrorsReadings at
4cf69b209(committed, clean tree)TZ=UTC ARCH_DOCS_BASE=55503e16b359f034d71328f920aae6bbf674e0d1 npm run verify— exit 0, 8 suites, 4656 tests / 4656 pass / 0 fail,arch-docs: OK (13 changed file(s)).node core/scripts/build-client.mjs --check— exit 0.node scripts/ds-bot-patches.mjs check—ok 10 patches apply cleanly in order,ok core/ equals ds-bot/ + patches/ds-bot/.node scripts/ds-bot-patches.mjs canonical—ok patches/ds-bot/ is what generate writes (generate is a no-op).generateon the committed tree wrote nothing (git status --porcelainempty afterwards).55503e16tree with only the two new test files: 6 tests / 1 pass / 5 fail —sidebar-readonly-reloadred on the Reload control in both shapes, on Reload starting the full-state read, on a failed reload using the sidebar error channel, and on the two-shape style/rail rule;client-reload-statered as a file because the sources had no fresh-request pair yet.git grep -nE '^(<{7}|={7}|>{7})' -- docs core patches changelog.danswers no line (exit 1).Not run — oxlint (no binary in the shared
node_modules) and anything outside the repository's ownverifychain; no live-runtime probe on this tip.Checkpoint
{ "pr": 2265, "claim": "Dev2", "issue": 2247, "summary": "The read-only sidebar banner now carries a Reload button in both the wide and the rail shape. It sits beside the status line, not inside the role=status region, so the live region stays text. Pressing it runs the client's new reloadTeam action, which asks the host for a whole team read (no since) so an unchanged revision still re-reads readOnly, and the poll stands back while a reload is in flight. Two new test files cover the control in both shapes, the fresh request, the stale-answer rule and the sidebar error channel.", "files": ["core/src/client/sidebar.js", "core/src/client/sources.js", "core/src/client/index.js", "core/test/sidebar-readonly-reload.test.js", "core/test/client-reload-state.test.js", "docs/subsystems/core-client.md", "changelog.d/2247-readonly-banner-reload.fixed.md"], "checks": { "ran": "node --import ./test/harness-resolve.mjs --test test/sidebar-readonly-reload.test.js test/client-reload-state.test.js; node core/scripts/build-client.mjs --check; node scripts/ds-bot-patches.mjs check", "result": "green", "at": "4cf69b209b4980f9efdfc85998c08a11672cf972" }, "next": "none — ready for review" }